package com.gp.controller;

import com.gp.service.CarTypeService;
import com.gp.entity.TbCarType;
import com.gp.util.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("rent/carType")
public class CarTypeConreoller {

    @Autowired
    private CarTypeService carTypeService;

    @PostMapping("findAll")
    private CommonResult findAll(Integer page,Integer limit, String nametype){
        return carTypeService.findAllType(page, limit, nametype);
    }

    @DeleteMapping("delCarById")
    private CommonResult delCarById(Integer id){
        return carTypeService.delTypeById(id);
    }

    @PostMapping("insert")
    private CommonResult insert(@RequestBody TbCarType tbCarType){
        return carTypeService.insert(tbCarType);
    }

    @PutMapping("updateCartype")
    private CommonResult updateCartype(@RequestBody TbCarType tbCarType){
        return carTypeService.updateCarType(tbCarType);
    }



}
